﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Roguelike
{
    public partial class MainForm : Form
    {
        private Renderer _renderer;
        public MainForm()
        {
            InitializeComponent();

            _renderer = new Renderer(this);
            this.Size = new Size(_renderer.WidthInPixels + 10, _renderer.HeightInPixels + 25);
        }

        private void Form1_Click(object sender, EventArgs e)
        {
            _renderer.UpdateGrid();
        }

        private void Form1_KeyDown(object sender, KeyEventArgs e)
        {
            var a = new Stopwatch();
            a.Start();
            _renderer.UpdateGrid();
            
            a.Stop();
            Console.WriteLine("Updated in {0}", a.ElapsedMilliseconds);
        }
    }
}
